From fe6ed1ce99db7ade83400233742cb15f95df65bd Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 23 Mar 2006 18:47:43 +0100 Subject: [PATCH] on_selected_cpus() must not send IPIs with empty target masks. This causes send accept errors on Pentium/P6 . Signed-off-by: Keir Fraser --- xen/arch/x86/smp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c index 690bf3121f..fc0a545883 100644 --- a/xen/arch/x86/smp.c +++ b/xen/arch/x86/smp.c @@ -106,6 +106,16 @@ void send_IPI_self(int vector) __send_IPI_shortcut(APIC_DEST_SELF, vector); } +static inline void check_IPI_mask(cpumask_t cpumask) +{ + /* + * Sanity, and necessary. An IPI with no target generates a send accept + * error with Pentium and P6 APICs. + */ + ASSERT(cpus_subset(cpumask, cpu_online_map)); + ASSERT(!cpus_empty(cpumask)); +} + /* * This is only used on smaller machines. */ @@ -115,6 +125,8 @@ void send_IPI_mask_bitmask(cpumask_t cpumask, int vector) unsigned long cfg; unsigned long flags; + check_IPI_mask(cpumask); + local_irq_save(flags); /* @@ -146,6 +158,8 @@ inline void send_IPI_mask_sequence(cpumask_t mask, int vector) unsigned long cfg, flags; unsigned int query_cpu; + check_IPI_mask(mask); + /* * Hack. The clustered APIC addressing mode doesn't allow us to send * to an arbitrary mask, so I do a unicasts to each CPU instead. This @@ -304,6 +318,9 @@ extern int on_selected_cpus( ASSERT(local_irq_is_enabled()); + if ( nr_cpus == 0 ) + return 0; + data.func = func; data.info = info; data.wait = wait; -- 2.30.2